package com.morphiastic.conversion;

public class IntegerConverter extends ElasticConverter<Integer>{

	@Override
	public Integer fromIndexValue(Object val) {
		try{
			return Integer.parseInt(val.toString());
		}catch (NumberFormatException e) {}
		return null;
	}
	
	
	@Override
	public String toIndexValue(Object value) {
		if(value == null)return null;
		return value.toString();
	}

}
